
using System;
using System.Linq;
using System.Collections.Generic;
using MonoTouch.Foundation;
using System.IO;

namespace ComBrowser
{

	public static class Settings
	{
		static NSUserDefaults plist = NSUserDefaults.StandardUserDefaults;


		public static int ZeroBasedSelectedBookID {
			get {
				
				int s = plist.IntForKey ("zeroBasedSelectedBookID");
				return s;
			}
			set { plist.SetInt (value, "zeroBasedSelectedBookID"); }
		}

		public static int ZeroBasedSelectedChapterID {
			get {
				
				int s = plist.IntForKey ("zeroBasedSelectedChapterID");
				return s;
			}
			set { plist.SetInt (value, "zeroBasedSelectedChapterID"); }
		}

		public static bool HasDBBeenInstalled {
			get {
				
				bool i = plist.BoolForKey ("HasDBBeenInstalled");
				return i;
				
			}
			set { plist.SetBool (value, "HasDBBeenInstalled"); }
		}

 
		public static int TextSize {
			get {
			 
				if (String.IsNullOrEmpty(plist.StringForKey ("TextSize"))) {
					plist.SetInt (1,"TextSize");
				}
				
				return plist.IntForKey ("TextSize");
				
			}
			set {
				plist.SetInt (value,"TextSize");
			}
		}

		public static int Font {
			get {
				
				if (String.IsNullOrEmpty (plist.StringForKey ("Font"))) {
					plist.SetInt (1, "Font");
				}
				
				return plist.IntForKey ("Font");
			
			}
			set { plist.SetInt (value, "Font"); }
		}

		public static int ColorScheme {
			get {
				
				if (String.IsNullOrEmpty (plist.StringForKey ("ColorScheme"))) {
					plist.SetInt (1, "ColorScheme");
				}
				
				return plist.IntForKey ("ColorScheme");
			
			}
			set { plist.SetInt (value, "ColorScheme"); }
		}

		public static string DatabasePath {


			get { return 
				
				Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "DB/Active.db3"); 
			
			
			}
		}
		
	}
}
